InMemoryDefaultStatesManagerRepo

class InMemoryDefaultStatesManagerRepo<T : State>(map: MutableMap<Any, T>) : DefaultStatesManagerRepo<T>

Simple DefaultStatesManagerRepo for DefaultStatesManager which will store data in map and use primitive functionality

Constructors

InMemoryDefaultStatesManagerRepo
Link copied to clipboard
fun <T : State> InMemoryDefaultStatesManagerRepo(map: MutableMap<Any, T> = mutableMapOf())

Functions

contains
Link copied to clipboard
open suspend override fun contains(context: Any): Boolean
getContextState
Link copied to clipboard
open suspend override fun getContextState(context: Any): T?
getStates
Link copied to clipboard
open suspend override fun getStates(): List<T>
removeState
Link copied to clipboard
open suspend override fun removeState(state: T)

Remove exactly state. In case if internally State.context is busy with different State, that State should NOT be removed

set
Link copied to clipboard
open suspend override fun set(state: T)

Must save state as current state of chain with State.context of state